﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace _8_重写父类的ToString__
{
    class Program
    {
        static void Main(string[] args)
        {
            Person p = new Person();
            Console.WriteLine(p.ToString());//将打印类的命名空间
            Console.ReadKey();
        }
    }

    public class Person
    {
        public override string ToString()//子类重写了父类的虚方法
        {
            return "被重写了";
        }
    }
}
